// Animator
// (c) jimon game studio

#ifndef JEH_IANIMATOR
#define JEH_IANIMATOR

#include "jeUnknown.h"
#include "ISerialize.h"
#include "jeStl.h"

namespace je
{
	namespace scene
	{
		class ISceneNode;

		//! Animator
		class IAnimator:public je::core::ISerialize
		{
		protected:
			ISceneNode * ParentNode;
			jeStringd AnimatorName;
			jeStringc AnimatorType;
		public:
			//! Constructor
			IAnimator(const jeStringd & SetAnimatorName)
				:ParentNode(NULL),AnimatorName(SetAnimatorName),AnimatorType(SetAnimatorName.c_str())
			{
			}

			//! Destructor
			virtual ~IAnimator()
			{
			}

			//! Set Node
			virtual void SetNode(ISceneNode * Node)
			{
				ParentNode = Node;
			}

			//! Get Node
			virtual ISceneNode * GetNode()
			{
				return ParentNode;
			}

			//! Set Name
			virtual void SetName(const jeStringd & NewName)
			{
				AnimatorName = NewName;
			}

			//! Get Name
			virtual const jeStringd & GetName()
			{
				return AnimatorName;
			}

			//! On Update
			virtual void OnUpdate()
			{
			}

			//! Serialize
			virtual void Serialize(core::ISerializeStream * SerializeStream)
			{
				JE_SS_BEGIN(Animator)
				JE_SS(AnimatorName)
				JE_SS(AnimatorType)
				JE_SS_END(Animator)
			}
			
			//! Get Animator Type Name
			jeStringc GetAnimatorTypeName()
			{
				return AnimatorType;
			}
		};
	}
}

#endif
